home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / eflibpt4.zip / DEMO / SCREEN / WRITE3.PAS < prev   
Pascal/Delphi Source File  |  1996-07-21  |  1KB  |  34 lines

  1. { Borland Pascal Extended Function Library - EFLIB (C) Johan Larsson, 1996
  2.   Demonstration; screen write #3 - diagonal line drawing
  3.  
  4.   EFLIB IS PROTECTED BY THE COPYRIGHT LAW AND MAY NOT BE COPIED, SOLD OR
  5.   MANIPULATED. FOR MORE INFORMATION, SEE PROGRAM MANUAL! THIS DEMONSTRAT-
  6.   ION PROGRAM MAY FREELY BE USED AND DISTRIBUTED.                          }
  7.  
  8.  
  9. uses EFLIBDEF, EFLIBSCR;
  10.  
  11. const Laps = 1; MaximumRotation : word = 100;
  12.  
  13. var Count, Index : word; Rotation : real;
  14.  
  15.  
  16. begin
  17.      { Clear the screen }
  18.      Screen.Clear;
  19.  
  20.      for Count := 1 to Laps do begin
  21.          for Index := 1 to MaximumRotation do begin
  22.              Rotation := (2 * Pi / MaximumRotation) * Index;
  23.              { Draw a line }
  24.              Screen.DrawLine (40, 12, Round(40 + 39 * Sin (Rotation)), Round(12 + 11 * Cos (Rotation)), #219, Random(16));
  25.          end;
  26.          { Change number of rotations }
  27.          MaximumRotation := MaximumRotation div 3;
  28.          for Index := MaximumRotation downto 1 do begin
  29.              Rotation := (2 * Pi / MaximumRotation) * Index;
  30.              { Draw a line }
  31.              Screen.DrawLine (40, 12, Round(40 + 14 * Sin (Rotation)), Round(12 + 7 * Cos (Rotation)), #176, Random(16));
  32.          end;
  33.      end;
  34. end.